import Layout from '@/layouts/index.vue';
import { isDeviceExport } from '@/utils/common';

export default [
  {
    path: '/home',
    component: Layout,
    redirect: '/home/index',
    name: 'index',
    meta: {
      title: {
        zh_CN: '首页',
        en_US: 'Home',
      },
      icon: 'home',
      single: true,
    },
    children: [
      {
        path: 'index',
        name: 'HomeIndex',
        component: () => import('@/pages/home/index.vue'),
        meta: {
          title: {
            zh_CN: '首页',
            en_US: 'Home',
          },
        },
      },
    ],
  },
  {
    path: '/source',
    component: Layout,
    redirect: isDeviceExport() ? '/source/list' : '/source/edit',
    name: 'source',
    meta: {
      title: {
        zh_CN: '源管理',
        en_US: 'Source Manager',
      },
      icon: 'code',
      single: true,
    },
    children: [
      {
        path: 'list',
        name: 'SourceList',
        component: () => import('@/pages/source/list/index.vue'),
        meta: {
          title: {
            zh_CN: '源列表',
            en_US: 'Source List',
          },
        },
      },
      {
        path: 'edit',
        name: 'SourceEdit',
        component: () => import('@/pages/source/edit/index.vue'),
        meta: {
          title: {
            zh_CN: '源编辑',
            en_US: 'Edit Source',
          },
          hidden: true,
        },
      },
    ],
  },
  {
    path: '/document',
    component: Layout,
    redirect: '/document/index',
    name: 'document',
    meta: {
      title: {
        zh_CN: '文档中心',
        en_US: 'document',
      },
      icon: 'document',
      single: true,
    },
    children: [
      {
        path: 'index',
        name: 'DocumentIndex',
        component: () => import('@/pages/document/index.vue'),
        meta: {
          title: {
            zh_CN: '文档中心',
            en_US: 'Document',
          },
        },
      },
    ],
  },
];
